////////////////////////////////////////////////////////////////
//	File	:	"CTransitionScreen.h"
//
//	Author	:	James Gonzalez (JG)
//
//	Purpose	:	This class loads all the level data for the game
////////////////////////////////////////////////////////////////
#pragma once
#include <vector>

class IGameState;
class CTransitionScreen
{

private:

	struct tTransitionItem 
	{
		
	
		int m_nXPos;
		int m_nYPos;
		int m_nXVel;
		int m_nYVel;
		
		int m_nImageID;

		void Setup(int nImageID, int nXPos, int nYPos, int nXVel, int nYVel)
		{
			m_nImageID = nImageID;
			m_nXPos = nXPos;
			m_nYPos = nYPos;
			m_nXVel = nXVel;
			m_nYVel = nYVel;
		}

		void Update(float fElapsedTime)
		{
			
			m_nXPos += (int)(m_nXVel*fElapsedTime);
			m_nYPos += (int)(m_nYVel*fElapsedTime);	 
				
		}



	};	

	bool m_bIsStopped;
	bool m_bIsOpenning;
	bool m_bIsClosed;

	tTransitionItem m_tDoorFrame;
	tTransitionItem m_tLeftDoor;
	tTransitionItem m_tRightDoor;
	tTransitionItem m_tTVFrame;
	tTransitionItem m_tTVScreen;

	CTransitionScreen();
	CTransitionScreen(const CTransitionScreen&);
	CTransitionScreen& operator=(const CTransitionScreen&);
	~CTransitionScreen();


public:


	static CTransitionScreen* GetInstance(void)
	{ 
		static CTransitionScreen Instance; 
		return &Instance; 
	}

	////////////////////////////////////////////////////////
	//	Function:	"Update"
	//	Last Modifies: September 7,2008
	//	Purpose:	Updates the transition.
	////////////////////////////////////////////////////////
	void Update(float fElapsedTime);


	////////////////////////////////////////////////////////
	//	Function:	"CloseDoor"
	//	Last Modifies: September 7,2008
	//	Purpose:	closes the transition.
	////////////////////////////////////////////////////////
	void CloseDoor();

	////////////////////////////////////////////////////////
	//	Function:	"OpenDoor"
	//	Last Modifies: September 7,2008
	//	Purpose:	opens the transition.
	////////////////////////////////////////////////////////
	void OpenDoor();


	////////////////////////////////////////////////////////
	//	Function:	"ResetDoors"
	//	Last Modifies: September 7,2008
	//	Purpose:	Resets the transition.
	////////////////////////////////////////////////////////
	void ResetDoors();


	////////////////////////////////////////////////////////
	//	Function:	"Render"
	//	Last Modifies: September 7,2008
	//	Purpose:	Render the transition.
	////////////////////////////////////////////////////////
	void Render();


	////////////////////////////////////////////////////////
	//	Function:	"ChangingState"
	//	Last Modifies: September 8,2008
	//	Purpose:	Close door and change state then open door.
	////////////////////////////////////////////////////////
	void ChangeTo(IGameState*cState);


	////////////////////////////////////////////////////////
	//	Function:	"Accessors"
	//	Last Modifies: September 7,2008
	//	Purpose:	Get data
	////////////////////////////////////////////////////////
	bool GetIsOpenning()  { return m_bIsOpenning; }
	bool GetIsClosed()  { return m_bIsClosed; }
	bool GetIsStopped() { return m_bIsStopped;}


};